cmake_minimum_required(VERSION 3.16)

project(tcp_demo LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)

if (MSVC)
  add_compile_options("/utf-8")
elseif (UNIX)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()

# 查找当前目录下的源文件和头文件
file(GLOB SOURCES
    "*.cpp"
    "*.h"
)

add_executable(tcp_demo ${SOURCES})

include(${CMAKE_SOURCE_DIR}/../../../DAQ_SDK/DAQ_SDK.cmake)

target_link_libraries(tcp_demo PRIVATE ${DAQ_SDK_DEPENDENT_LIBRARIES})
target_include_directories(tcp_demo PRIVATE ${DAQ_SDK_INCLUDE_DIRS})

include(GNUInstallDirs)
install(TARGETS tcp_demo
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
